<?php

namespace app\admin\controller;

use think\Request;
use app\common\model\Article as ArticleModel;
use app\common\model\Category;
use app\common\server\TreeData;

class Article extends Base
{
    public function lst(){
        $list = ArticleModel::getList();
        $this->assign("list",$list);
        return $this->fetch();
    }

    public function add(Request $request){
        if($request->isPost()){

        }else{
            $cat_list = Category::getList()->toArray();
            $cat_list=TreeData::tree($cat_list,'cat_name');
            $this->assign("cat_list",$cat_list);
            return $this->fetch();
        }
    }
}
